package com.atguigu.day08.HomeWork.HomeWork2;

/**
 * @version 1.0
 * @Author 马冰
 * @Date 2024/11/8 21:40
 * @注释
 */
public class Person {
    private String name;
    private int age;
    private String career;

    public Person(String name, int age, String career) {
        this.name = name;
        this.age = age;
        this.career = career;
    }

    public void eat(){
        System.out.println(getName() + "在吃饭");
    }
    public void toilet(){
        System.out.println(getName() + "在上洗手间");
    }
    public String toString(){
        return getName() + " " + getAge() + " " + getCareer();
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getCareer() {
        return career;
    }

    public void setCareer(String career) {
        this.career = career;
    }
}
